import Vue from 'vue'
import Router from 'vue-router'


Vue.use(Router)

/* Layout */
import Layout from '../views/layout/Layout'


/*export const constantRouterMap = [
  { path: '/login', component: () => import('@/views/login/index'), hidden: true },
  { path: '/404', component: () => import('@/views/404'), hidden: true },

  {
    path: '/',
    component: Layout,
    name: 'Layout',
    hidden: true,
    children:[{
      path: '/orderDetails',
      name: 'orderDetails',
      component: () => import('@/views/orderDetails/index'),
      meta: { title: '订单详情', icon: 'nested' }
    }]
  },
  {
    path: '/orderList',
    component: Layout,
    children: [
      {
        path: 'index',
        name: 'orderList',
        component: () => import('@/views/orderList/index'),
        meta: { title: '订单列表', icon: 'nested' }
      },
      
    ]
  },
  { //orderList  accountManagement
    path: '/accountManagement',
    component: Layout,
    children: [
      {
        path: 'index',
        name: 'accountManagement',
        component: () => import('@/views/accountManagement/index'),
        meta: { title: '子账号管理', icon: 'tree' }
      }
    ]
  },
// nested table  tree
 
  { path: '*', redirect: '/404', hidden: true }
]*/
export const constantRouterMap = [
  { path: '/login', component: () => import('@/views/login/index'), hidden: true },
  { path: '/404', component: () => import('@/views/404'), hidden: true },

  {
    path: '/',
    component: Layout,
    name: 'Layout',
    hidden: true,
    children:[{
      path: '/orderDetails',
      name: 'orderDetails',
      component: () => import('@/views/orderDetails/index'),
      meta: { title: '订单详情', icon: 'nested' }
    }]
  },
  {
    path: '/orderList',
    component: Layout,
    children: [
      {
        path: 'index',
        name: 'orderList',
        component: () => import('@/views/orderList/index'),
        meta: { title: '贷款超市管理', icon: 'tree' }
      },
      
    ]
  },
  {
    path: '/setup',
    component: Layout,
    hidden:true,
    children: [
      {
        path: 'index',
        name: 'setup',
        component: () => import('@/views/setup/index'),
        meta: { title: '设置',}
      },
      
    ]
  },
  { //orderList  accountManagement
    path: '/accountManagement',
    component: Layout,
    children: [
      {
        path: 'index',
        name: 'accountManagement',
        component: () => import('@/views/accountManagement/index'),
        meta: { title: '贷款超市数据统计', icon: 'nested' }
      }
    ]
  },
// nested table  tree
 
  { path: '*', redirect: '/404', hidden: true }
]
export default new Router({
  // mode: 'history', //后端支持可开
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
})

